/* 文章页面专用样式，覆盖全局设置 */
html, body {
  /* Apply homepage background */
  background-image: 
    /* Top layer: Noise Texture (subtle) */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E"),
    /* Middle layer: Subtle Cool Gray Gradient (for mist effect) */
    linear-gradient(120deg, rgba(170, 180, 190, 0.05), rgba(140, 150, 165, 0.08)),
    /* Bottom layer: Your 4K Wallpaper */
    url("/images/9d55360de3e4671e250d98139ce19cea.jpeg");
  
  background-size: auto, auto, cover;
  background-position: 0 0, 0 0, center top;
  background-repeat: repeat, no-repeat, no-repeat; 
  background-attachment: fixed; 
  background-color: #333a45; /* Fallback */

  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  position: relative !important;
  min-height: 100vh !important;
  line-height: 1.75 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Elegant Scrollbars (from global styles) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(74, 85, 104, 0.3); /* Using a color from the theme (e.g., text-gray-600/slate-600 alpha) */
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(74, 85, 104, 0.5);
}

/* 确保文章容器可以延伸 */
.article-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative; /* For subtle glow positioning */
}

/* Subtle atmospheric glow (adapted from .subtle-glow) */
.article-container::before {
  content: '';
  position: absolute; /* Changed from fixed to be relative to article-container */
  top: 50%;
  left: 50%;
  width: 80vw; /* Adjust size as needed */
  height: 80vh; /* Adjust size as needed */
  max-width: 1000px; /* Cap max size */
  max-height: 800px; /* Cap max size */
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(126, 156, 214, 0.08) 0%, /* Softer alpha */
    rgba(126, 156, 214, 0) 65%  /* Fade out sooner */
  );
  filter: blur(60px); /* Increased blur */
  transform: translate(-50%, -50%);
  z-index: 0; /* Behind article content card */
  pointer-events: none;
  opacity: 0.7; /* Initial opacity */
}

/* 确保文章内容可滚动 */
article {
  overflow-y: visible !important;
  flex-grow: 1;
}

/* 防止某些容器限制滚动 */
.page-glass-container,
.container,
main,
#content-area,
[class*="min-h-screen"] {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
}

/* 确保文本内容可见 */
.prose {
  overflow-y: visible !important;
  max-height: none !important;
}

/* 文章排版优化 */
.prose p {
  font-family: 'Noto Serif SC', serif !important;
  color: #4a5568 !important;
  line-height: 1.9 !important;
  margin-bottom: 1.75em;
  font-size: 1.05rem;
}

/* 优化文章标题排版 */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: 'Noto Serif SC', serif !important;
  color: #1a202c !important;
  margin-bottom: 0.75em;
  line-height: 1.35;
}

.prose h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.8em;
}

.prose h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 2em;
}

.prose h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 1.75em;
}

/* 适应不同设备的响应式字体大小 */
@media (max-width: 768px) {
  .prose h1 {
    font-size: 1.875rem;
  }
  .prose h2 {
    font-size: 1.5rem;
  }
  .prose h3 {
    font-size: 1.25rem;
  }
  .prose p {
    font-size: 1rem;
    line-height: 1.8 !important;
  }
}

/* 美化链接样式 */
.prose a {
  color: #2b6cb0 !important;
  text-decoration: none !important;
  transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
  border-bottom: 1px solid #bee3f8;
}

.prose a:hover {
  color: #2c5282 !important;
  border-bottom-color: #2c5282;
}

/* 优化阅读宽度 */
.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 高对比度文本，更易阅读 */
.text-gray-700 {
  color: #374151 !important;
}

.text-gray-900 {
  color: #111827 !important;
}

/* 美化引用样式 */
.prose blockquote {
  border-left: 3px solid #4299e1;
  padding: 0.5em 1em;
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
  color: #4a5568;
  background-color: #ebf8ff;
  border-radius: 0.25rem;
}

.prose blockquote p {
  margin-bottom: 0.5em;
}

/* 改善代码块样式 */
.prose pre {
  background-color: #1a202c !important;
  color: #e2e8f0 !important;
  border-radius: 0.375rem;
  padding: 1.25em;
  overflow-x: auto;
  font-family: 'Fira Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 0.9em;
  line-height: 1.6;
}

.prose code {
  font-family: 'Fira Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  background-color: #edf2f7 !important;
  color: #2d3748 !important;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.prose pre code {
  background-color: transparent !important;
  color: inherit !important;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* 改善移动设备上的内容间距 */
@media (max-width: 640px) {
  main.article-content {
    padding: 1.5rem 0;
  }
  .container {
    padding: 0 1rem;
  }
}

/* 按钮统一样式 - Integrating global .btn animations */
.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, transform 0.2s ease; /* Added transform */
  border: 1px solid transparent;
  cursor: pointer;
  position: relative; /* For pseudo-elements */
  overflow: hidden;   /* For pseudo-elements */
}

/* Shimmer/Glare effect from global .btn */
.btn-base::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25), /* Slightly more visible shimmer */
    transparent
  );
  transition: left 0.7s ease;
  z-index: 1;
}

.btn-base:hover::before {
  left: 100%;
}

/* Radial pulse effect from global .btn (optional, can be subtle) */
.btn-base::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0; /* Behind shimmer */
}

.btn-base:hover::after {
  opacity: 0.6; /* Make it appear on hover */
}

/* Active state from global .btn */
.btn-base:active {
  transform: translateY(1px) scale(0.98);
}

.btn-outline-subtle {
  composes: btn-base;
  color: #4a5568;
  background-color: transparent;
  border-color: #cbd5e0;
}

.btn-outline-subtle:hover {
  background-color: #f7fafc;
  color: #2d3748;
  border-color: #a0aec0;
}

.btn-secondary-subtle {
  composes: btn-base;
  color: #4a5568;
  background-color: #edf2f7;
}

.btn-secondary-subtle:hover {
  background-color: #e2e8f0;
  color: #2d3748;
}

.btn-danger-subtle {
  composes: btn-base;
  color: #c53030;
  background-color: #fff5f5;
  border-color: #fed7d7;
}

.btn-danger-subtle:hover {
  background-color: #fed7d7;
  color: #9b2c2c;
  border-color: #fbb6b6;
}

/* Share button enhancements */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem; /* Slightly larger */
  height: 2.25rem; /* Slightly larger */
  border-radius: 50%;
  background-color: rgba(237, 242, 247, 0.8); /* Match poetic card bg with alpha */
  color: #4a5568;
  transition: all 0.3s ease; /* Smoother transition */
  position: relative; /* For pseudo-elements */
  overflow: hidden;   /* For pseudo-elements */
  border: 1px solid rgba(203, 213, 224, 0.5); /* Subtle border to match glass */
}

.share-btn::before { /* Shimmer */
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.7s ease;
  z-index: 1;
}
.share-btn:hover::before {
  left: 100%;
}

.share-btn:hover {
  background-color: rgba(226, 232, 240, 0.9); /* Lighter hover */
  color: #2d3748;
  transform: translateY(-2px) scale(1.05); /* More pronounced hover effect */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.share-btn svg {
  width: 1rem; /* Increased icon size */
  height: 1rem; /* Increased icon size */
  position: relative; /* Ensure icon is above pseudo-elements if needed */
  z-index: 2;
}

/* 头部和页脚样式 */
header.sticky {
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom-color: rgba(203, 213, 224, 0.6) !important;
}

footer {
  background-color: #f7fafc !important;
  border-top-color: rgba(203, 213, 224, 0.6) !important;
}

/* 文章元信息标签 */
.article-meta-tag {
  display: inline-block;
  background-color: #ebf8ff;
  color: #2b6cb0;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #bee3f8;
}

/* 动画效果 */
@keyframes pulse-once {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.group-hover\:animate-pulse-once:hover svg,
.group:hover .group-hover\:animate-pulse-once svg {
  animation: pulse-once 0.6s ease-in-out;
}

/* 确保 `prose` 样式不会覆盖自定义链接颜色 */
.prose a, .prose a:hover {
  text-decoration: none !important;
}

/* 主要内容区域样式 */
.article-content {
  padding-top: 3rem; /* Increased padding */
  padding-bottom: 3rem; /* Increased padding */
  position: relative; 
  z-index: 10;
}

/* Applying .poetic-card styles to .article-content > .container */
.article-content > .container {
  /* Basic structure from .poetic-card */
  position: relative;
  overflow: hidden; /* Important for pseudo-elements */
  border-radius: 1rem; /* From poetic-card, or keep previous 0.75rem/1rem */
  padding: 2.5rem 3rem; /* Default padding, can be responsive */
  transition: all 0.4s ease; /* Slower transition from poetic-card */
  
  /* Background and base shadow from .poetic-card */
  background: rgba(255, 255, 255, 0.97); /* Slightly more opaque than default poetic */
  backdrop-filter: blur(10px); /* Softer blur than poetic-card's 12px if desired, or match */
  box-shadow: 
    0 6px 25px -8px rgba(97, 87, 72, 0.18), /* Adjusted shadow */
    0 0 0 1px rgba(0, 0, 0, 0.04); /* Softer border/edge highlight */
    /* inset 0 0 20px rgba(255, 255, 255, 0.5); Removed inset shadow for readability */
}

/* ::before pseudo-element from .poetic-card for top-right gradient */
.article-content > .container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(163, 191, 217, 0.12) 0%, /* Softer alpha */
    transparent 65% /* Fade out sooner */
  );
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  z-index: 1;
}

/* ::after pseudo-element from .poetic-card for border gradient mask */
.article-content > .container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px; /* Border thickness */
  background: linear-gradient(
    135deg,
    transparent 20%, /* Adjust gradient points */
    rgba(163, 191, 217, 0.25) 45%, /* Softer/adjusted alpha */
    rgba(163, 191, 217, 0.15) 55%,
    transparent 80%
  );
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask-composite: xor-deprecated; /* Using deprecated for wider compatibility, ensure it works or use 'exclude' */
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease; /* Faster transition */
  z-index: 2;
}

/* Hover effects from .poetic-card - MODIFIED TO REMOVE ANIMATION */
.article-content > .container:hover {
  /* transform: translateY(-5px); */ /* REMOVED hover transform */
  /* Enhanced shadow on hover - can be kept if subtle or also removed */
  /* box-shadow: 
    0 15px 35px -10px rgba(97, 87, 72, 0.2), 
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 0 0 4px rgba(163, 191, 217, 0.08); */ 
  /* Base shadow will remain from the non-hover state */
}

.article-content > .container:hover::before {
  /* opacity: 0.7; */ /* REMOVED hover opacity change for ::before */
  /* Keep base opacity if needed, or ensure it's 0 if only for hover */
  opacity: 0; /* Explicitly keep it hidden if it was only for hover */
}

.article-content > .container:hover::after {
  /* opacity: 0.9; */ /* REMOVED hover opacity change for ::after */
  /* Keep base opacity if needed, or ensure it's 0 if only for hover */
  opacity: 0; /* Explicitly keep it hidden if it was only for hover */
}

@media (max-width: 768px) {
  .article-content > .container {
    padding: 2rem 1.5rem; /* Adjusted padding */
    border-radius: 0.75rem; /* Adjusted radius */
  }
  /* No specific :hover transform needed here anymore */
  /* .article-content > .container:hover {
    transform: translateY(-3px); 
  } */
}

/* Sticky header specific adjustments if it uses article-header-glass */
header.sticky.article-header-glass {
  /* background-color: rgba(255, 255, 255, 0.85) !important; */ /* Keep existing or use the new glass */
  /* backdrop-filter: blur(12px) !important; */
  /* border-bottom-color: rgba(203, 213, 224, 0.6) !important; */
  /* These values are now inherited from .article-header-glass, or can be fine-tuned here */
}

/* Footer specific adjustments if it uses article-footer-glass */
footer.article-footer-glass {
  /* background-color: #f7fafc !important; */
  /* border-top-color: rgba(203, 213, 224, 0.6) !important; */
  /* These values are now inherited from .article-footer-glass */
}

/* 确保 `prose` 样式不会覆盖自定义链接颜色 */
.prose a, .prose a:hover {
  text-decoration: none !important; /* Keep this, important for prose overrides */
}

/* 富文本内容的表格样式 */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.prose table th {
  background-color: #f7fafc;
  font-weight: 600;
  text-align: left;
  padding: 0.75em;
  border: 1px solid #e2e8f0;
}

.prose table td {
  padding: 0.75em;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}

.prose table tr:nth-child(even) {
  background-color: #f9fafb;
}

/* 确保表格在移动设备上可横向滚动 */
.prose table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .prose table {
    display: table;
    white-space: normal;
  }
}

/* 图片样式 */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  margin: 1.5em 0;
}

/* 富文本编辑器生成的图片容器 */
.prose p[data-href] {
  text-align: center;
} 